package org.nf.mvc.servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Author : LLH
 * @create 2021/5/28
 *
 * 抽象的视图对象，用于视图响应
 * 由不同的子类去实现各自的相应逻辑
 */
public abstract class View {

    protected HttpServletRequest request;
    protected HttpServletResponse response;

    public void setRequest(HttpServletRequest request) {
        this.request = request;
    }

    public void setResponse(HttpServletResponse response) {
        this.response = response;
    }

    /**
     * 抽象的视图相应方法
     */
    protected abstract void response() throws ServletException, IOException;
}
